


//获取鼠标坐标

document.addEventListener( 'contextmenu' , function( e ){
    
    //获取鼠标位置

    let x = e.clientX
    let y = e.clientY

    let sxBox = document.querySelector( '.sx_box' )
    // console.log(sxBox);
    
    sxBox.style.display = 'block'
    //鼠标的坐标位置赋值给菜单
    sxBox.style.left = `${x}px`
    sxBox.style.top = `${y}px`

    //取消默认点击菜单
    e.preventDefault();

    document.addEventListener('click' , function(){
        document.querySelector( '.sx_box' ).style.display = 'none'
    })
    


})